<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <table id="class_date_confdg">
        <thead>
            <tr>
                <th data-options="field:'ID',checkbox:true"></th>
                 <th data-options="field:'CLASS_DATE',title:'上课时间',width:40,
                editor:{
                    type:'combobox',
                    options: {  
                        data: [{'value': '周一'},{'value': '周二'},{'value': '周三'},{'value': '周四'},{'value': '周五'}],
                        valueField: 'value',  
                        textField: 'value',  
                        mode:'remote',
                        multiple:true,
                        editable:false,
                        required:true
                    } 
                }"></th>
            </tr>
        </thead>
    </table>
    <script type="text/javascript">
        $(function(){
            var url = "/kccsCourse/class_date_conf";
            loadDatagrid("class_date_conf", url);
        })
        function loadDatagrid(cf, url){
            dgEditIndex[cf]=-1;
            var btnArr=[];
            btnArr.push({text:'修改',iconCls:'icon-edit',handler:function(){modify(cf)}},'-');
            btnArr.push({text:'保存',iconCls:'icon-save',handler:function(){save(cf)}},'-');
            btnArr.push({text:'取消',iconCls:'icon-undo',handler:function(){undo(cf)}});  
            $("#"+cf+"dg").datagrid({
                url: url + "/pageQuery.html",
                rownumbers:true,
                striped:true,
                border:false,
                pagination:false,
                pageSize:30,
                fitColumns:true,
                singleSelect: true,
                fit: true,
                toolbar: btnArr,
                onAfterEdit: function(rowIndex,rowData,changes){
                    if($.isEmptyObject(changes)) {
                        var dgObj=$('#'+cf+'dg');
                        dgObj.datagrid('rejectChanges');
                        dgEditIndex[cf]=-1;
                        return; 
                    }
                    changes.ID = rowData.ID;
                    addmodify(changes, cf, url)
                }
            })
        }
    </script>

</body>
</html>